<?php
    use yii\helpers\Html;
    use yii\helpers\Url;
    use yii\widgets\ActiveForm;
    use backend\utils\ImageSize;
?>
<style type="text/css">
    .has-success .text-danger{color: #1ab394;}
    .ajaxUpload{border:1px dashed #666;width: 100px;height:100px;background-color: #d6d6d6;border-radius: 4px;cursor: pointer;line-height: 100px;text-align: center;background-size: cover;}
    .ajaxUpload:hover{border-color: #333;}
    .upload_progress{height:5px;width:100px;margin-top: 5px;display:none;}
</style>
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">

            <div class="ibox">
                <div class="ibox-title">
                    <h5><?=Html::a('<i class="fa fa-angle-left"></i> 返回','javascript:history.go(-1);',['class'=>'btn btn-xs btn-white'])?> 编辑学生</h5>
                </div>
                <div class="ibox-content">
                    <?= Html::beginForm('','post',['id' => 'login-form','class' => 'form-horizontal m-t pass-form'])?>
                        <?=Html::activeInput('hidden',$model, 'id') ?>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="text-danger">*&nbsp;</span>昵称：</label>
                            <div class="col-sm-2">
                                <?=Html::activeInput('text',$model, 'nickname',['class'=>'form-control']) ?>
                                <?=Html::error($model,'nickname',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">头像：</label>
                            <div class="col-sm-5">
                                <div class="ajaxUpload" id="" style="background:url('<?=ImageSize::image(['url'=>$model->icon,'width'=>100,'high'=>100])?>')"></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">手机号：</label>
                            <div class="col-sm-2">
                                <?=Html::activeInput('text',$model, 'resetTelephone',['class'=>'form-control','disabled'=>'disabled']) ?>
                                <?=Html::error($model,'telephone',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">地区：</label>
                            <div class="col-sm-5 select_area form-inline">
                                <?= $area_select?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">生日：</label>
                            <div class="col-sm-2">
                                <?=Html::activeInput('text',$model, 'birthday',['class'=>'form-control','id'=>'birthday']) ?>
                                <?=Html::error($model,'birthday',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">个性签名：</label>
                            <div class="col-sm-5">
                                <?=Html::activeTextarea($model, 'autograph',['class'=>'form-control']) ?>
                                <?=Html::error($model,'autograph',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <?=Html::submitButton('保存',['class'=>'btn btn-primary col-md-offset-2'])?>
                                <?=Html::a('返回','javascript:history.go(-1);',['class'=>'btn btn-white'])?>
                            </div>
                        </div>
                    <?=Html::endForm() ?>
                </div>
            </div>
        </div>
    </div>
    <script src="/js/plugins/chosen/chosen.jquery.js"></script>
    <script src="/js/plugins/sweetalert/sweetalert.min.js"></script>
    <script src="/js/plugins/layer/laydate5.0.7/laydate.js" type="text/javascript"></script>
    <script type="text/javascript" src="/js/plugins/plupload-2.1.2/plupload.full.min.js"></script>
    <script type="text/javascript" src="/js/plugins/plupload-2.1.2/oss_upload.js" ></script>
    <script>
        laydate.render({
            elem: '#birthday'
            ,value: '<?=!empty($model->birthday)?$model->birthday:''?>'
        });
    </script>